package com.ocean.friendship.service.impl;

import java.util.List;

import com.ocean.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ocean.friendship.mapper.TSFriendshipLinkMapper;
import com.ocean.friendship.domain.TSFriendshipLink;
import com.ocean.friendship.service.ITSFriendshipLinkService;
import com.ocean.common.core.text.Convert;

/**
 * 友情链接Service业务层处理
 *
 * @author ocean
 * @date 2024-02-19
 */
@Service
public class TSFriendshipLinkServiceImpl implements ITSFriendshipLinkService
{
    @Autowired
    private TSFriendshipLinkMapper tSFriendshipLinkMapper;

    /**
     * 查询友情链接
     *
     * @param id 友情链接主键
     * @return 友情链接
     */
    @Override
    public TSFriendshipLink selectTSFriendshipLinkById(String id)
    {
        return tSFriendshipLinkMapper.selectTSFriendshipLinkById(id);
    }

    /**
     * 查询友情链接列表
     *
     * @param tSFriendshipLink 友情链接
     * @return 友情链接
     */
    @Override
    public List<TSFriendshipLink> selectTSFriendshipLinkList(TSFriendshipLink tSFriendshipLink)
    {
        return tSFriendshipLinkMapper.selectTSFriendshipLinkList(tSFriendshipLink);
    }

    /**
     * 新增友情链接
     *
     * @param tSFriendshipLink 友情链接
     * @return 结果
     */
    @Override
    public int insertTSFriendshipLink(TSFriendshipLink tSFriendshipLink)
    {
        tSFriendshipLink.setId(IdUtils.simpleUUID());
        return tSFriendshipLinkMapper.insertTSFriendshipLink(tSFriendshipLink);
    }

    /**
     * 修改友情链接
     *
     * @param tSFriendshipLink 友情链接
     * @return 结果
     */
    @Override
    public int updateTSFriendshipLink(TSFriendshipLink tSFriendshipLink)
    {
        return tSFriendshipLinkMapper.updateTSFriendshipLink(tSFriendshipLink);
    }

    /**
     * 批量删除友情链接
     *
     * @param ids 需要删除的友情链接主键
     * @return 结果
     */
    @Override
    public int deleteTSFriendshipLinkByIds(String ids)
    {
        return tSFriendshipLinkMapper.deleteTSFriendshipLinkByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除友情链接信息
     *
     * @param id 友情链接主键
     * @return 结果
     */
    @Override
    public int deleteTSFriendshipLinkById(String id)
    {
        return tSFriendshipLinkMapper.deleteTSFriendshipLinkById(id);
    }

    /**
     * 友情链接
     * @return
     */
    @Override
    public List<TSFriendshipLink> getyqlj() {
        return tSFriendshipLinkMapper.getyqlj();
    }
}
